Skip to content

Conversation

@stevensJourney
Copy link
Collaborator

Overview

The @powersync/service-core package currently exports various route definitions and some functions for registering the routes on a server.

Routes are usually registered in the server runner inside the project service folder/package. The current configuration required duplication of the route registration between different projects.

This PR introduces utility functions which perform the common route registration. The registration itself is still configurable if projects require custom functionality.

@changeset-bot
Copy link

changeset-bot bot commented Jul 25, 2024

🦋 Changeset detected

Latest commit: 1ac7e5a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@powersync/service-core Minor
@powersync/service-image Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR


export const syncStreamReactive: SocketRouteGenerator = (router) =>
router.reactiveStream<util.StreamingSyncRequest, any>(SyncRoutes.STREAM, {
authorize: ({ context }) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The token is now checked on the connection level. This is no longer necessary.

@stevensJourney stevensJourney marked this pull request as ready for review July 25, 2024 14:33
@stevensJourney stevensJourney requested a review from rkistner July 25, 2024 14:33
@stevensJourney stevensJourney merged commit 3f994ae into main Jul 25, 2024
@stevensJourney stevensJourney deleted the neaten-websockets branch July 25, 2024 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants